import pandas as pd


#读取数据并赋值对象
df = pd.read_excel("/root/qianfeng/day7/emp.xlsx")
"""
#定义筛选策略  筛选年龄在30岁及以上的员工
condation = (df['年龄'] >= 30)
#将筛选之后的数据打印
data=df.loc[condation,["姓名","年龄"]]


#写入数据
with pd.ExcelWriter("/root/qianfeng/day7/person.xlsx") as writer:
    data.to_excel(writer)
"""


#统计每个城市的员工数量
data = df ["城市"].value_counts()
#data1 = df["城市"].str.contains("县")
print(data) 

#年龄在30岁及以上，工资大于15000的员工
condation = (df["年龄"] >= 30) & (df["工资"] > 15000)
print(df.loc[condation, ["姓名","年龄", "工资"]])
